<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>显示与隐藏</title>
</head>
<body>
<div id="app">
    <h1 v-if="isShow">v-if的HelloWorld</h1>
    <h1 v-else>张三</h1>

    <h1 v-show="isShow">v-show的哈哈哈哈</h1>

    <input type="button" value="显示" @click="show"/>
    <input type="button" value="隐藏" @click="hide"/>
</div>

<script src="js/vue.js"></script>
<script>
    var vue = new Vue({
        el: "#app",
        data: {
            isShow: true
        },
        methods:{
            show(){
                this.isShow = true;
            },
            hide(){
                this.isShow = false;
            }
        }
    });
</script>
</body>
</html>